﻿/*
Purpose: Math helper class
Created: EE / 28-07-2009

Copyright (c) 2003 - 2009 by EE

All rights reserved.

Copyright / Usage Details:

You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise) 
when your product is released in binary form. You are allowed to modify the source code in any way you want 
except you cannot modify the copyright details at the top of each module. If you want to distribute source 
code with your application, then you are only allowed to distribute versions released by the author. This is 
to maintain a single distribution point for the source code. 

*/

using System;
namespace AAPlus
{
    public static class MathExtra
    {
        public static float Mod(float input, out float integerPart)
        {
            integerPart = (int)Math.Floor(input);
            var remainder = input - (float)integerPart;
            return remainder;
        }

        public static double Mod(double input, out double integerPart)
        {
            decimal integerPart2 = (decimal)Math.Floor(input);
            var remainder = (decimal)input - integerPart2;
            integerPart = (double) integerPart2;
            return (double)remainder;
        }
    }
}
